State.h
Language: C++
Last Modified: 2022-09-10 5:29:27 PM UTC
File Size: 1818 bytes
Last Modified: 2022-09-10 5:29:27 PM UTC
File Size: 1818 bytes
http://www.penguinstew.ca/example/CodeFormater/State.h
pragmaonce
include<string>
include<vector>
include<regex>
include<libxmltreeh>
includeTypeIdPairh
enumclassStateTypes
{
IncludeStart
IncludeStartWord
ExcludeStart
NoColour
};
classState
{
Idofthisstate
intid;
typeofthestate
StateTypestype;
stylenameofthecolourtodisplay
std::stringcolour;
Truetotestfornestedstates
boolallowNested;
Truetotestforescapecharacters
booluseEscape;
Startingcharacters
std::stringstartSequence;
Endingcharacters
std::stringendSequence;
Theregularexpressiontousewhentestingwordboundaries
std::stringregExText;
std::regexregEx;
Usedwithsymtypetoindicatewordstotestfor
std::vector<std::string>words;
std::vector<TypeIdPair>startIds;
boolendAfterWord;
boolendAfterLine;
public:
staticconststd::stringSTATE_PATTERN_LINE;
staticconststd::stringSTATE_PATTERN_WORD;
State;
StatexmlNodePtrxmlNode;
intGetId;
StateTypesGetType;
std::stringGetColour;
boolGetAllowNested;
boolGetUseEscapee;
std::stringGetStartSequence;
std::stringGetEndSequence;
std::regexGetRegEx;
std::vector<std::string>GetWords;
std::vector<TypeIdPair>GetStartIds;
boolIsEndAfterWord;
boolIsEndAfterLine;
boolIsStartstd::stringlineintposTypeIdPairtypeIdstd::stringescapse;
boolIsEndstd::stringlineintposTypeIdPairtypeIdstd::stringescapse;
intPrintStartstd::stringstreamlineStreamstd::stringlineintpos;
intPrintEndstd::stringstreamlineStream;
voidPrintRestartstd::stringstreamlineStream;
voidPrintClosestd::stringstreamlineStream;
std::stringFindStateWordstd::stringlineintpos;
std::stringToString;
};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68